


//
//  CellFirstNewSongsRect.m
//  练习11
//
//  Created by 张琦 on 15/11/21.
//  Copyright © 2015年 张琦. All rights reserved.
//

#import "CellFirstNewSongsRect.h"
#import "UIImageView+WebCache.h"
@interface CellFirstNewSongsRect ()
@property (nonatomic, retain) UIImageView *imageTitle;
@property (nonatomic, retain) UILabel *labelTitle;

@end
@implementation CellFirstNewSongsRect







- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}




- (void)createView
{
    
    
    self.imageTitle = [[UIImageView alloc] init];
    self.imageTitle.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.imageTitle];
    
    self.labelTitle = [[UILabel alloc] init];
    self.labelTitle.backgroundColor = [UIColor cyanColor];
    [self.contentView addSubview:self.labelTitle];
}

- (void)setDic:(NSDictionary *)dic
{
    if (_dic != dic) {
        [_dic release];
        _dic = [dic retain];
    }
    self.labelTitle.text = [dic objectForKey:@"name"];
    [self.imageTitle sd_setImageWithURL:[NSURL URLWithString:[dic objectForKey:@"picUrl"]]];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.imageTitle.frame = CGRectMake(10, 5, 80, 80);
    self.labelTitle.frame = CGRectMake(100, 5, 260, 80);
}


@end
